<?php
	date_default_timezone_set("Asia/ShangHai");
	//include_once "./api/function.php";
	include("config.php");
	//$url = $_GET['url'];
	$callback = htmlentities($_GET['callback']);
	$face_id = (int)$_GET['face_id'];
	//$user = htmlentities($_GET['user']);
	//echo $url;
	$Connect = new PDO('mysql:host='.$db['host'].';dbname='.$db['database'], $db['user'], $db['pass']);
	$Connect->query("set names 'utf8'");
	$sql = "update `face_resource` set `face_download` = `face_download` + 1 where `face_id` = '".$face_id."'";
	$ret = $Connect->query($sql);
	echo $callback."(0)";
	/*
	$sql = "select `face_name` from `face_resource` where `face_id` = '".$face_id."'";
	$exec = $Connect->query($sql);
	$filename = mb_convert_encoding($exec->fetchColumn(0).".gif","gbk","utf8");
	$ret = download($url);
	header("Content-type:application/gif");
	header('Content-Disposition: attachment; filename="'.$filename.'"');
	echo $ret;
	*/
?>